// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'  
import VueRouter from 'vue-router'  
import routes from './router.config' 
import axios from 'axios'  
import VueLazyload from 'vue-lazyload' 
//import vuex from 'vuex' 
import store from './store/index'
import App from './App'
import './assets/font/iconfont.css'
import './assets/css/base.css'   //全局css
Vue.use(VueRouter);   //全局使用
//Vue.use(vuex);
const router = new VueRouter({
  routes
});
// const store = new vuex.Store({
//   state:{
//     flag:'123'
//   }
// });
Vue.use(VueLazyload,{
  preLoad:1.3,
  error: require('./assets/images/err.png'),
  loading: require('./assets/images/loading.gif'),
  attempt:3,
  listenEvents:['scroll']
});
Vue.config.productionTip = false   //阻 止启动生产消息
axios.defaults.baseURL='http://192.168.0.104:3333/';
axios.defaults.headers['Content-Type'] = 'application/x-www-form-urlencoded'
Vue.prototype.$http = axios;
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  //components: { App },    1.0的写法
  //template: '<App/>'
  render:h=>h(App)   //2.0写法
})
// render:function(createElement) {
//   return createElement(App)
// }
